var url = decodeURI(location.href); // 获取URL
var sum;
var counts = '';
function getQueryString(url) {
    var useUrl = url.split("?")[1];
    var params = new Array();
    params = useUrl.split("&");
    var needParams = new Array();
    for (var i = 0; i < params.length; i++) {
        var needParam = params[i].split("=")[1];
        needParams.push(needParam);
    }
    return needParams;
}

var pageThis = 0;
var pagecount = 5;
var index = 0;
var type;

var nowPage = 0;
var size = 5;

var getSchoolDynamicsUrl = baseUrl + "/common/schoolCommunicate/getSchoolDynamics";
var getMarxSchoolUrl = baseUrl + "/common/schoolCommunicate/getMarxSchool";
var getTeacherResourceUrl = baseUrl + "/common/famousTeacher/getTeacherResource";
var searchResourceUrl = baseUrl + "/common/famousTeacher/searchResource";
var searchCommonResourceUrl = baseUrl + "/common/resource/searchCommonResource";

$(function () {
    // 获取最新新闻
    getNewsFresh();

    var type = getQueryString(url)[0];

    if (type == "gongGao") {
        // 获取首页公告
        getNews3();
    } else if (type == "shiZheng") {
        // 获取首页时政要闻
        getNews();
    } else if (type == "mingXiao") {
        // 获取首页名校交流
        getSchoolDynamics();
    } else if (type == "zjxinWen") {
        // 获取首页浙江新闻
        getNews2();
    } else if (type == "shouYe_xinWenReDian") {
        // 获取首页新闻热点
        getCommonNewsXinWenReDian();
    } else if (type == "shouYe_jingCaiYiKe") {
        // 获取首页精彩一课
        getCommonResourceJingCaiYiKe();
    } else if (type == "shouYe_mingXiaoDongTai") {
        // 获取首页名校动态
        getSchoolDynamicsMingXiaoDongTai();
    } else if (type == "shouYe_ruZhuMingShi") {
        // 获取首页入驻名师
        getTeacherRuZhuMingShi();
    } else if (type == "video") {
        // 获取教学资源库首页精彩一课
        getResource();
    } else if (type == "jxal") {
        // 获取教学资源库首页教学案例
        getResourceNews();
    } else if (type == "zxsczy") {
        // 获取教学资源库首页最新上传资源
        getResourceupload();
    } else if (type == "gxjl_main_geXiaoDongTai") {
        // 获取高校交流页面各校动态
        getGxjlSchoolDynamics();
    } else if (type == "gxjl_main_zhongDianMaYuan") {
        // 高校交流重点马院
        getGxjlMarxSchool();
    } else if (type == "gxjl_main_zhuanTiYanJiu") {
        // 高校交流专题研究
        getGxjlZtyjNews();
    } else if (type == "gxjl_main_chengGuoZhanShi") {
        // 高校交流
        getGxjlChengGuoZhanShi();
    } else if (type == "fourBook_liLunQianYan") {
        // 四本书理论前沿
        getFourBookTheoreticalFrontiers();
    } else if (type == "fourBook_shiPinSuCai") {
        if (url.split("?")[1].split("&")[1].split("=")[0] == "sectionId") {
            var sectionId = getQueryString(url)[1];

            // 四本书视频素材
            getFourBookGetResource(sectionId);
        } else if (url.split("?")[1].split("&")[1].split("=")[0] == "chapterId") {
            var chapterId = getQueryString(url)[1];

            // 四本书视频素材
            getFourBookGetResourceByChapterId(chapterId);
        }
    } else if (type == "fourBook_jingCaiYiKe") {
        if (url.split("?")[1].split("&")[1].split("=")[0] == "sectionId") {
            var sectionId = getQueryString(url)[1];

            // 四本书精彩一课
            getFourBookSearchCommonResourceJingCaiYiKe(sectionId);
        } else if (url.split("?")[1].split("&")[1].split("=")[0] == "chapterId") {
            var chapterId = getQueryString(url)[1];

            // 四本书精彩一课
            getFourBookSearchCommonResourceJingCaiYiKeByChapterId(chapterId);
        }
    } else if (type == "fourBook_jiaoXueAnLi") {
        var bookId = getQueryString(url)[1];

        // 四本书教学案例
        getFourBookJiaoXueAnLi(bookId);
    } else if (type == "fourBook_wenDangSuCai") {
        if (url.split("?")[1].split("&")[1].split("=")[0] == "sectionId") {
            var sectionId = getQueryString(url)[1];

            // 四本书文档素材
            searchCommonResourceWenDangSuCai(sectionId);
        } else if (url.split("?")[1].split("&")[1].split("=")[0] == "chapterId") {
            var chapterId = getQueryString(url)[1];

            // 四本书文档素材
            searchCommonResourceWenDangSuCaiByChapterId(chapterId);
        }
    } else if (type == "fourBook_qiTaSuCai") {
        if (url.split("?")[1].split("&")[1].split("=")[0] == "sectionId") {
            var sectionId = getQueryString(url)[1];

            // 四本书其他素材
            searchCommonResourceQiTaSuCai(sectionId);
        } else if (url.split("?")[1].split("&")[1].split("=")[0] == "chapterId") {
            var chapterId = getQueryString(url)[1];

            // 四本书其他素材
            searchCommonResourceQiTaSuCaiByChapterId(chapterId);
        }
    } else if (type == "mingShi_xueShuZhuZuo") {
        var teacherId = getQueryString(url)[1];

        // 名师学术著作
        getMingShiResourceXueShuZhuZuoOne(teacherId);
    } else if (type == "mingShi_jiaoXueChengGuo") {
        var teacherId = getQueryString(url)[1];

        // 名师教学成果
        getMingShiResourceJiaoXueChengGuoOne(teacherId);
    } else if (type == "mingShi_xueShuLunWen") {
        var teacherId = getQueryString(url)[1];

        // 名师学术论文
        getMingShiResourceXueShuLunWenOne(teacherId);
    } else if (type == "mingShi_woDeShiPin") {
        var teacherId = getQueryString(url)[1];

        // 名师我的视频
        getMingShiResourceWoDeShiPin(teacherId);
    } else if (type == "mingShi_wangLuoZiYuan") {
        var teacherId = getQueryString(url)[1];

        // 名师网络资源
        getMingShiResourceWangLuoZiYuan(teacherId);
    } else if (type == "ggzyk_zheJiangShiPin") {
        var bookId = getQueryString(url)[1];

        var tClassificationId = getQueryString(url)[2];

        // 公共资源库浙江视频
        searchResourceZheJiangShiPin(tClassificationId);
    } else if (type == "ggzyk_jiangDianWenXian") {
        var bookId = getQueryString(url)[1];

        var tClassificationId = getQueryString(url)[2];

        // 公共资源库经典文献
        getNewsGgzykJingDianWenXian(tClassificationId);
    } else if (type == "ggzyk_canYueZiLiao") {
        var bookId = getQueryString(url)[1];

        var tClassificationId = getQueryString(url)[2];

        // 公共资源库参阅资料
        getNewsGgzykCanYueZiLiao(tClassificationId);
    } else if (type == "ggzyk_zuiXin") {
        var bookId = getQueryString(url)[1];

        var tClassificationId = getQueryString(url)[2];

        // 公共资源库最新
        getNewsZuiXin(tClassificationId);
    } else if (type == "zjjs_shiJianAnLi") {
        // 浙江精神实践案例
        getNewsZjjsShiJianAnLi();
    } else if (type == "zjjs_hongChuanJingShen") {
        // 红船精神
        getNewsZjjsHongChuanJingShen();
    } else if (type == "zjjs_zheJiangXinWen") {
        // 浙江新闻
        getNewsZjjsZheJiangXinWen();
    } else if (type == "zjjs_liLunYanJiu") {
        // 理论研究
        getNewsZjjsLiLunYanJiu();
    } else if (type == "zjjs_zheJiangShiPin") {
        // 浙江视频
        searchCommonResourceZjjsZheJiangShiPin();
    } else if (type == "souSuo") {
        // 教学资源库搜索
        var keyWord = getQueryString(url)[1];
        getSearchDetials(keyWord);
    } else if (type == "gxjl_main_zheJiangXinWen") {
        // 获取高校交流页面各校动态
        getGxjlZheJiangXinWen();
    } else if (type == "gxjl_main_zhuanJiaGuanDian") {
        // 获取高校交流页面专家观点
        getGxjlZhuanJiaGuanDian();
    } else if (type == "gxjl_main_huiYiJiLu") {
        // 获取高校交流页面会议记录
        getGxjlHuiYiJiLu();
    } else if (type == "titleSouSuo") {
        var keyWord = getQueryString(url)[1];

        var tClassificationId = getQueryString(url)[2];

        // 公共资源库标题搜索
        getGgzykTitleSouSuo(keyWord, tClassificationId);
    } else if (type == "contentSouSuo") {
        var keyWord = getQueryString(url)[1];

        var tClassificationId = getQueryString(url)[2];

        // 公共资源库内容搜索
        getGgzykContentSouSuo(keyWord, tClassificationId);
    }
})

// 最新新闻
function getNewsFresh() {
    var data = {
        typeId: 2,
        page: index,
        size: 5
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/getNews", getNewsFresh_fun);
}
function getNewsFresh_fun(res) {
    var newsListsFresh = res.obj.content;
    if (res.status == "SUCCESS") {
        $.each(newsListsFresh, function (i, newsListFresh) {
            $(".mainBox").find(".leftBox").find(".leftBoxBotom").find(".gonggao").find("ul").append('<li onclick="lookgongGaoDetail(this)" data-id="' + newsListFresh.id + '"  theType="gg"><a href="javascript:;">' + newsListFresh.title + '</a></li>');
        })

    }
}

/******************************************** 首页 ********************************************/

// 公告
function getNews3() {
    var data = {
        typeId: 3,
        page: index,
        size: pagecount
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/getNews", getNews3_fun);
}
function getNews3_fun(res) {
    type = "gg";
    var newsLists3 = res.obj.content;
    console.log(res);
    if (res.status == "SUCCESS") {
        $(".RightBoxBottom").find(".toptitle").html("公告");

        sum = res.obj.totalElements;
        counts = sum / pagecount;
        if (newsLists3.length != 0) {
            if (sum % pagecount == 0) {
                counts = parseInt(sum / pagecount);
            }
            else {
                counts = parseInt(sum / pagecount) + 1;
            }
            $("#pagination").paging({
                pageNo: pageThis,
                totalPage: counts,
                totalSize: sum,
                callback: function (num) {
                    console.log(num);
                    index = num - 1;
                    getNews3();
                    pageThis = num;
                }
            });
            $(".RightBoxBottom").find(".list").empty();
            $.each(newsLists3, function (i, newsList3) {
                $(".RightBoxBottom").find(".list").append('<a onclick="lookgongGaoDetail(this)" data-id="' + newsList3.id + '"  theType="' + type + '"><li class="clearfix"> ' +
                    '<div>' +
                    newsList3.title +
                    '</div> ' +
                    '<div class="small-list"> ' +
                    '<p>' + changeTime2(newsList3.creatTime) + '</p> ' +
                    '</div> ' +
                    '</li></a>')
            })
        } else {
            alert("无信息");
        }
    }
}

// 时政要闻
function getNews() {
    var data = {
        typeId: 3,
        page: index,
        size: pagecount
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/getNews", getNews_fun);
}
function getNews_fun(res) {
    type = "gg";
    var newsLists = res.obj.content;
    //console.log(res);
    if (res.status == "SUCCESS") {
        $(".RightBoxBottom").find(".toptitle").html("时政要闻");
        sum = res.obj.totalElements;
        counts = sum / pagecount;
        if (newsLists.length != 0) {
            if (sum % pagecount == 0) {
                counts = parseInt(sum / pagecount);
            }
            else {
                counts = parseInt(sum / pagecount) + 1;
            }
            $("#pagination").paging({
                pageNo: pageThis,
                totalPage: counts,
                totalSize: sum,
                callback: function (num) {
                    console.log(num);
                    index = num - 1;
                    getNews();
                    pageThis = num;
                }
            });
            $(".RightBoxBottom").find(".list").empty();
            $.each(newsLists, function (i, newsList) {
                $(".RightBoxBottom").find(".list").append('<a onclick="lookgongGaoDetail(this)" data-id="' + newsList.id + '"  theType="' + type + '"><li class="clearfix"> ' +
                    '<div>' +
                    newsList.title +
                    '</div> ' +
                    '<div class="small-list"> ' +
                    '<p>' + changeTime2(newsList.creatTime) + '</p> ' +
                    '</div> ' +
                    '</li></a>')
            })
        } else {
            alert("无信息");
        }


    }
}

// 名校交流
function getSchoolDynamics() {
    var data = '{"page":"' + index + '","size":"' + pagecount + '","type":"DYNAMICS"}';
    AjaxSubmit("GET", JSON.parse(data), basePath + "/common/firstPage/getSchoolDynamics", getSchoolDynamics_fun);
}
function getSchoolDynamics_fun(res) {
    type = "mxjl";
    var schoolLists = res.obj.content;
    //console.log(res);
    if (res.status == "SUCCESS") {
        $(".RightBoxBottom").find(".toptitle").html("名校交流");
        sum = res.obj.totalElements;
        counts = sum / pagecount;
        if (schoolLists.length != 0) {
            if (sum % pagecount == 0) {
                counts = parseInt(sum / pagecount);
            }
            else {
                counts = parseInt(sum / pagecount) + 1;
            }
            $("#pagination").paging({
                pageNo: pageThis,
                totalPage: counts,
                totalSize: sum,
                callback: function (num) {
                    console.log(num);
                    index = num - 1;
                    getSchoolDynamics();
                    pageThis = num;
                }
            });
            $(".RightBoxBottom").find(".list").empty();
            $.each(schoolLists, function (i, schoolList) {
                $(".RightBoxBottom").find(".list").append('<a onclick="lookgongGaoDetail(this)" data-id="' + schoolList.id + '"  theType="' + type + '"><li class="clearfix"> ' +
                    '<div>' +
                    schoolList.title +
                    '</div> ' +
                    '<div class="small-list"> ' +
                    '<p>' + changeTime2(schoolList.creatTime) + '</p> ' +
                    '</div> ' +
                    '</li></a>')
            })
        } else {
            alert("无信息");
        }

    }
}

// 浙江新闻
function getNews2() {
    var data = {
        typeId: 2,
        page: index,
        size: pagecount
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/getNews", getNews2_fun);
}
function getNews2_fun(res) {
    type = "gg";
    var newsLists2 = res.obj.content;
    //console.log(res);
    if (res.status == "SUCCESS") {
        $(".RightBoxBottom").find(".toptitle").html("浙江新闻");
        sum = res.obj.totalElements;
        counts = sum / pagecount;
        if (newsLists2.length != 0) {
            if (sum % pagecount == 0) {
                counts = parseInt(sum / pagecount);
            }
            else {
                counts = parseInt(sum / pagecount) + 1;
            }
            $("#pagination").paging({
                pageNo: pageThis,
                totalPage: counts,
                totalSize: sum,
                callback: function (num) {
                    console.log(num);
                    index = num - 1;
                    getNews2();
                    pageThis = num;
                }
            });
            $(".RightBoxBottom").find(".list").empty();
            $.each(newsLists2, function (i, newsLists) {
                $(".RightBoxBottom").find(".list").append('<a onclick="lookgongGaoDetail(this)" data-id="' + newsLists.id + '"  theType="' + type + '"><li class="clearfix"> ' +
                    '<div>' +
                    newsLists.title +
                    '</div> ' +
                    '<div class="small-list"> ' +
                    '<p>' + changeTime2(newsLists.creatTime) + '</p> ' +
                    '</div> ' +
                    '</li></a>')
            })
        } else {
            alert("无信息");
        }
    }
}

// 获取首页新闻热点
function getCommonNewsXinWenReDian() {
    var data = {
        page: 0,
        size: 5,
        status: "UP"
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/searchCommonNews", getCommonNewsXinWenReDianRes, data);
}
function getCommonNewsXinWenReDianRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "shouYe_xinWenReDian";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("新闻热点");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/firstPage/searchCommonNews", size, nowPage, data, "getCommonNewsXinWenReDianRes");
}

// 获取首页精彩一课
function getCommonResourceJingCaiYiKe() {
    var data = {
        page: 0,
        size: 5,
        type: "WONDERFUL_LESSON",
        status: "UP"
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/searchCommonResource", getCommonResourceJingCaiYiKeRes, data);
}
function getCommonResourceJingCaiYiKeRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "shouYe_jingCaiYiKe";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("精彩一课");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookVideoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + resultData[i].creatTime + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/firstPage/searchCommonResource", size, nowPage, data, "getCommonResourceJingCaiYiKeRes");
}

// 获取首页名校动态
function getSchoolDynamicsMingXiaoDongTai() {
    var data = {
        page: 0,
        size: 5,
        type: "DYNAMICS",
        status: "AUDITED",
        upDownType: "UP"
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/searchSchoolDynamics", getSchoolDynamicsMingXiaoDongTaiRes, data);
}
function getSchoolDynamicsMingXiaoDongTaiRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "shouYe_mingXiaoDongTai";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("名校动态");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/firstPage/searchSchoolDynamics", size, nowPage, data, "getSchoolDynamicsMingXiaoDongTaiRes");
}

// 获取首页入驻名师
function getTeacherRuZhuMingShi() {
    var data = {
        page: 0,
        size: 5,
        isFamousTeacher: 1
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/searchTeacher", getTeacherRuZhuMingShiRes, data);
}
function getTeacherRuZhuMingShiRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "shouYe_ruZhuMingShi";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("入驻名师");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a href="../html/ms_inside_watch.html?teacherId=' + resultData[i].id + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].teacherName + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/firstPage/searchTeacher", size, nowPage, data, "getTeacherRuZhuMingShiRes");
}

/******************************************** 教学资源库首页 ********************************************/

// 教学案例
function getResourceNews() {
    var data = {
        commonNewsTypeId: 7,
        status: "UP",
        page: index,
        size: pagecount
    };
    AjaxSubmit("GET", data, basePath + "/common/resource/getNews", getResourceNews_fun);
}
function getResourceNews_fun(res) {
    type = "jxal";
    var newsResourceLists = res.obj.content;
    //console.log(res);
    if (res.status == "SUCCESS") {
        $(".RightBoxBottom").find(".toptitle").html("教学案例");
        sum = res.obj.totalElements;
        counts = sum / pagecount;
        if (newsResourceLists.length != 0) {
            if (sum % pagecount == 0) {
                counts = parseInt(sum / pagecount);
            }
            else {
                counts = parseInt(sum / pagecount) + 1;
            }
            $("#pagination").paging({
                pageNo: pageThis,
                totalPage: counts,
                totalSize: sum,
                callback: function (num) {
                    console.log(num);
                    index = num - 1;
                    getResourceNews();
                    pageThis = num;
                }
            });
            $(".RightBoxBottom").find(".list").empty();
            $.each(newsResourceLists, function (i, newsResourceList) {
                $(".RightBoxBottom").find(".list").append('<a onclick="lookgongGaoDetail(this)" data-id="' + newsResourceList.id + '"  theType="' + type + '"><li class="clearfix"> ' +
                    '<div>' +
                    newsResourceList.title +
                    '</div> ' +
                    '<div class="small-list"> ' +
                    '<p>' + changeTime2(newsResourceList.creatTime) + '</p> ' +
                    '</div> ' +
                    '</li></a>')
            })
        } else {
            alert("无信息");
        }

    }
}

// 最新上传资源
function getResourceupload() {
    var data = {
        page: index,
        size: pagecount
    };
    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", getResourceupload_fun);
}
function getResourceupload_fun(res) {
    type = "zxsczy";
    console.log(res);
    var uploadResourceLists = res.obj.content;
    if (res.status == "SUCCESS") {
        $(".RightBoxBottom").find(".toptitle").html("最新上传资源");
        sum = res.obj.totalElements;
        counts = sum / pagecount;
        if (uploadResourceLists.length != 0) {
            if (sum % pagecount == 0) {
                counts = parseInt(sum / pagecount);
            }
            else {
                counts = parseInt(sum / pagecount) + 1;
            }
            $("#pagination").paging({
                pageNo: pageThis,
                totalPage: counts,
                totalSize: sum,
                callback: function (num) {
                    console.log(num);
                    index = num - 1;
                    getResourceupload();
                    pageThis = num;
                }
            });
            $(".RightBoxBottom").find(".list").empty();
            $.each(uploadResourceLists, function (i, uploadResourceList) {
                $(".RightBoxBottom").find(".list").append('<a onclick="lookgongGaoDetail(this)" data-id="' + uploadResourceList.id + '"  theType="' + type + '"><li class="clearfix"> ' +
                    '<div>' +
                    uploadResourceList.title +
                    '</div> ' +
                    '<div class="small-list"> ' +
                    '<p>' + changeTime2(uploadResourceList.creatTime) + '</p> ' +
                    '</div> ' +
                    '</li></a>')
            })
        } else {
            alert("无信息");
        }

    }
}

// 关键词搜索
function getSearchDetials(keyWord) {
    var data = {
        page: 0,
        size: 5,
        title: keyWord
    };

    AjaxSubmit("GET", data, basePath + "/common/commonResource/getNews", getSearchDetialsRes, data);
}
function getSearchDetialsRes(res, data) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_liLunQianYan";

    var resultData = res.obj.content;

    var listHtml = "";

    $(".RightBoxBottom").find(".toptitle").html("资源搜索");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/commonResource/getNews", size, nowPage, data, "getSearchDetialsRes");
}

/******************************************** 高校交流页面 ********************************************/

// 各校动态
function getGxjlSchoolDynamics() {
    var data = {
        page: 0,
        size: 5,
        type: "DYNAMICS"
    };

    commonAjax(getSchoolDynamicsUrl, data, "getGxjlSchoolDynamicsRes", "GET", data);
}
function getGxjlSchoolDynamicsRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "gxjl_main_geXiaoDongTai";

    var resultData = res.obj.content;

    var listHtml = "";

    $(".RightBoxBottom").find(".toptitle").html("各校动态");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getSchoolDynamicsUrl, size, nowPage, data, "getGxjlSchoolDynamicsRes");
}

// 成果展示
function getGxjlChengGuoZhanShi() {
    var data = {
        page: 0,
        size: 5,
        type: "HARVEST"
    };

    commonAjax(getSchoolDynamicsUrl, data, "getGxjlChengGuoZhanShiRes", "GET", data);
}
function getGxjlChengGuoZhanShiRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "gxjl_main_geXiaoDongTai";

    var resultData = res.obj.content;

    var listHtml = "";

    $(".RightBoxBottom").find(".toptitle").html("成果展示");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getSchoolDynamicsUrl, size, nowPage, data, "getGxjlChengGuoZhanShiRes");
}


// 重点马院
function getGxjlMarxSchool() {
    var data = {
        page: 0,
        size: 5
    };

    commonAjax(getMarxSchoolUrl, data, "addMarxSchool", "GET", data);
}
function addMarxSchool(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("重点马院");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick=toMarx("' + resultData[i].url + '")><li class="clearfix">';
        listHtml += '<div>' + resultData[i].marxSchool + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getMarxSchoolUrl, size, nowPage, data, "addMarxSchool");
}
function toMarx(url) {
    window.open(url);
}

// 专题研究
function getGxjlZtyjNews() {
    var data = {
        page: 0,
        size: 5,
        type: "RESEARCH"
    };

    commonAjax(baseUrl + "/common/schoolCommunicate/getSchoolDynamics", data, "getGxjlZtyjNewsRes", "GET", data);
}
function getGxjlZtyjNewsRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "gxjl_main_zhuanTiYanJiu";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("专题研究");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, baseUrl + "/common/schoolCommunicate/getSchoolDynamics", size, nowPage, data, "getGxjlZtyjNewsRes");
}

// 浙江新闻
function getGxjlZheJiangXinWen() {
    var data = {
        typeId: 2,
        page: index,
        size: pagecount
    };
    AjaxSubmit("GET", data, basePath + "/common/firstPage/getNews", getNews2_fun);
}

// 专家观点
function getGxjlZhuanJiaGuanDian() {
    var data = {
        page: 0,
        size: 5,
        type: "OPINION"
    };

    commonAjax(getSchoolDynamicsUrl, data, "getGxjlZhuanJiaGuanDianRes", "GET", data);
}
function getGxjlZhuanJiaGuanDianRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "gxjl_main_geXiaoDongTai";

    var resultData = res.obj.content;

    var listHtml = "";

    $(".RightBoxBottom").find(".toptitle").html("专家观点");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getSchoolDynamicsUrl, size, nowPage, data, "getGxjlZhuanJiaGuanDianRes");
}

// 会议记录
function getGxjlHuiYiJiLu() {
    var data = {
        page: 0,
        size: 5,
        type: "REPORT"
    };

    commonAjax(getSchoolDynamicsUrl, data, "getGxjlHuiYiJiLuRes", "GET", data);
}
function getGxjlHuiYiJiLuRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "gxjl_main_geXiaoDongTai";

    var resultData = res.obj.content;

    var listHtml = "";

    $(".RightBoxBottom").find(".toptitle").html("会议记录");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getSchoolDynamicsUrl, size, nowPage, data, "getGxjlHuiYiJiLuRes");
}

/******************************************** 四本书页面 ********************************************/

// 理论前沿
function getFourBookTheoreticalFrontiers() {
    var data = {
        page: nowPage,
        size: size
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/getNews", getTheoreticalFrontiersRes, data);
}
function getTheoreticalFrontiersRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_liLunQianYan";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("理论前沿");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/resource/getNews", size, nowPage, data, "getTheoreticalFrontiersRes");
}

// 视频素材
function getFourBookGetResource(sectionId) {
    var data = {
        sectionId: sectionId,
        type: "VIDEO_MATERIAL",
        page: nowPage,
        size: size
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", getResourceShiPinSuCaiRes, data);
}
function getFourBookGetResourceByChapterId(chapterId) {
    var data = {
        chapterId: chapterId,
        type: "VIDEO_MATERIAL",
        page: nowPage,
        size: size
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", getResourceShiPinSuCaiRes, data);
}
function getResourceShiPinSuCaiRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_shiPinSuCai";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("视频素材");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookVideoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/resource/searchCommonResource", size, nowPage, data, "getResourceShiPinSuCaiRes");
}

// 精彩一课
function getFourBookSearchCommonResourceJingCaiYiKe(sectionId) {
    var data = {
        sectionId: sectionId,
        type: "WONDERFUL_LESSON",
        page: nowPage,
        size: size
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", searchCommonResourceJingCaiYiKeRes, data);
}
function getFourBookSearchCommonResourceJingCaiYiKeByChapterId(chapterId) {
    var data = {
        chapterId: chapterId,
        type: "WONDERFUL_LESSON",
        page: nowPage,
        size: size
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", searchCommonResourceJingCaiYiKeRes, data);
}
function searchCommonResourceJingCaiYiKeRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_jingCaiYiKe";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("视频素材");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookVideoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/resource/searchCommonResource", size, nowPage, data, "searchCommonResourceJingCaiYiKeRes");
}

// 教学案例
function getFourBookJiaoXueAnLi(bookId) {
    var data = {
        bookId: bookId,
        commonNewsTypeId: 7,
        status: "UP",
        page: nowPage,
        size: size
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/getNews", getNewsJiaoXueAnLiRes, data);
}
function getNewsJiaoXueAnLiRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_jiaoXueAnLi";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("视频素材");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/resource/getNews", size, nowPage, data, "getNewsJiaoXueAnLiRes");
}

// 文档素材
function searchCommonResourceWenDangSuCai(sectionId) {
    var data = {
        sectionId: sectionId,
        type: "DOCUMENT_MATERIAL",
        page: 0,
        size: 5
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", searchCommonResourceWenDangSuCai_fun, data);
}
function searchCommonResourceWenDangSuCaiByChapterId(chapterId) {
    var data = {
        chapterId: chapterId,
        type: "DOCUMENT_MATERIAL",
        page: 0,
        size: 5
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", searchCommonResourceWenDangSuCai_fun, data);
}
function searchCommonResourceWenDangSuCai_fun(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_wenDangSuCai";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("文档素材");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a href="' + resultData[i].fileUrl + '" target="_blank"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/resource/searchCommonResource", size, nowPage, data, "searchCommonResourceWenDangSuCai_fun");
}

// 其他素材
function searchCommonResourceQiTaSuCai(sectionId) {
    var data = {
        sectionId: sectionId,
        type: "OTHER_MATERIAL",
        page: 0,
        size: 5
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", searchCommonResourceQiTaSuCai_fun, data);
}
function searchCommonResourceQiTaSuCaiByChapterId(chapterId) {
    var data = {
        chapterId: chapterId,
        type: "OTHER_MATERIAL",
        page: 0,
        size: 5
    };

    AjaxSubmit("GET", data, basePath + "/common/resource/searchCommonResource", searchCommonResourceQiTaSuCai_fun, data);
}
function searchCommonResourceQiTaSuCai_fun(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_qiTaSuCai";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("其他素材");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a href="' + resultData[i].fileUrl + '" target="_blank"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/resource/searchCommonResource", size, nowPage, data, "searchCommonResourceQiTaSuCai_fun");
}

/******************************************** 名师页面 ********************************************/

// 学术著作
function getMingShiResourceXueShuZhuZuo(teacherId) {
    var data = {
        teacherId: teacherId,
        teacherResourceTypeId: 1,
        page: nowPage,
        size: size
    };

    commonAjax(getTeacherResourceUrl, data, "getMingShiResourceXueShuZhuZuoRes", "GET", data);
}
function getMingShiResourceXueShuZhuZuoRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "mingShi_xueShuZhuZuo";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("学术著作");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getTeacherResourceUrl, size, nowPage, data, "getMingShiResourceXueShuZhuZuoRes");
}

// 学术著作
function getMingShiResourceXueShuZhuZuoOne(teacherId) {
    var data = {
        teacherId: teacherId,
        teacherResourceTypeId: 1,
        page: nowPage,
        size: size
    };

    commonAjax(getTeacherResourceUrl, data, "getMingShiResourceXueShuZhuZuoOneRes", "GET", data);
}
function getMingShiResourceXueShuZhuZuoOneRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "mingShi_xueShuZhuZuo";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("学术著作");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getTeacherResourceUrl, size, nowPage, data, "getMingShiResourceXueShuZhuZuoOneRes");
}

// 教学成果
function getMingShiResourceJiaoXueChengGuo(teacherId) {
    var data = {
        teacherId: teacherId,
        teacherResourceTypeId: 2,
        page: nowPage,
        size: size
    };

    commonAjax(getTeacherResourceUrl, data, "getMingShiResourceJiaoXueChengGuoRes", "GET", data);
}
function getMingShiResourceJiaoXueChengGuoRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "mingShi_jiaoXueChengGuo";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("教学成果");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getTeacherResourceUrl, size, nowPage, data, "getMingShiResourceJiaoXueChengGuoRes");
}

// 教学成果
function getMingShiResourceJiaoXueChengGuoOne(teacherId) {
    var data = {
        teacherId: teacherId,
        teacherResourceTypeId: 2,
        page: nowPage,
        size: size
    };

    commonAjax(getTeacherResourceUrl, data, "getMingShiResourceJiaoXueChengGuoOneRes", "GET", data);
}
function getMingShiResourceJiaoXueChengGuoOneRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "mingShi_jiaoXueChengGuo";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("教学成果");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getTeacherResourceUrl, size, nowPage, data, "getMingShiResourceJiaoXueChengGuoOneRes");
}

// 学术论文
function getMingShiResourceXueShuLunWen(teacherId) {
    var data = {
        teacherId: teacherId,
        teacherResourceTypeId: 3,
        page: nowPage,
        size: size
    };

    commonAjax(getTeacherResourceUrl, data, "getMingShiResourceXueShuLunWenRes", "GET", data);
}
function getMingShiResourceXueShuLunWenRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "mingShi_xueShuLunWen";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("学术论文");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getTeacherResourceUrl, size, nowPage, data, "getMingShiResourceXueShuLunWenRes");
}

// 学术论文
function getMingShiResourceXueShuLunWenOne(teacherId) {
    var data = {
        teacherId: teacherId,
        teacherResourceTypeId: 3,
        page: nowPage,
        size: size
    };

    commonAjax(getTeacherResourceUrl, data, "getMingShiResourceXueShuLunWenOneRes", "GET", data);
}
function getMingShiResourceXueShuLunWenOneRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "mingShi_xueShuLunWen";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("学术论文");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getTeacherResourceUrl, size, nowPage, data, "getMingShiResourceXueShuLunWenOneRes");
}

// 我的视频
function getMingShiResourceWoDeShiPin(teacherId) {
    var data = {
        page: nowPage,
        size: size,
        userId: teacherId
    }

    commonAjax(searchResourceUrl, data, "getMingShiResourceWoDeShiPinRes", "GET", data);
}
function getMingShiResourceWoDeShiPinRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "mingShi_woDeShiPin";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("我的视频");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookVideoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, searchResourceUrl, size, nowPage, data, "getMingShiResourceWoDeShiPinRes");
}

// 网络资源
function getMingShiResourceWangLuoZiYuan(teacherId) {
    var data = {
        teacherId: teacherId,
        teacherResourceTypeId: 4,
        page: nowPage,
        size: size
    };

    commonAjax(getTeacherResourceUrl, data, "getMingShiResourceWangLuoZiYuanRes", "GET", data);
}
function getMingShiResourceWangLuoZiYuanRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "mingShi_wangLuoZiYuan";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("网络资源");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a href="' + resultData[i].file + '" target="_blank"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, getTeacherResourceUrl, size, nowPage, data, "getMingShiResourceWangLuoZiYuanRes");
}

/******************************************** 公共资源库 ********************************************/

// 浙江视频
function searchResourceZheJiangShiPin(tClassificationId) {
    var data = {
        thematicClassificationId: tClassificationId,
        commonNewsTypeId: 11,
        bookId: 5,
        page: nowPage,
        size: size
    };

    commonAjax(baseUrl + "/common/resource/getNews", data, "searchResourceZheJiangShiPinRes", "GET", data);
}
function searchResourceZheJiangShiPinRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "ggzyk_zuiXin";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("浙江经验");

    for (var i = 0; i < resultData.length; i++) {
        if (resultData[i].field3 == "1") {
            listHtml += '<a href="' + resultData[i].field2 + '" target="_blank">';
        } else {
            listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '">';
        }
        listHtml += '<li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, baseUrl + "/common/resource/getNews", size, nowPage, data, "searchResourceZheJiangShiPinRes");
}

// 经典文献
function getNewsGgzykJingDianWenXian(tClassificationId) {
    var data = {
        thematicClassificationId: tClassificationId,
        commonNewsTypeId: 9,
        bookId: 5,
        page: nowPage,
        size: size
    };

    commonAjax(baseUrl + "/common/resource/getNews", data, "getNewsGgzykJingDianWenXianRes", "GET", data);
}
function getNewsGgzykJingDianWenXianRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "ggzyk_jiangDianWenXian";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("经典文献");

    for (var i = 0; i < resultData.length; i++) {
        if (resultData[i].field3 == "1") {
            listHtml += '<a href="' + resultData[i].field2 + '" target="_blank">';
        } else {
            listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '">';
        }
        listHtml += '<li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, baseUrl + "/common/resource/getNews", size, nowPage, data, "getNewsGgzykJingDianWenXianRes");
}

// 参阅资料
function getNewsGgzykCanYueZiLiao(tClassificationId) {
    var data = {
        thematicClassificationId: tClassificationId,
        type: "CAN_YUE_ZI_LIAO",
        bookId: 5,
        page: nowPage,
        size: size
    };

    commonAjax(baseUrl + "/common/resource/searchCommonResource", data, "getNewsGgzykCanYueZiLiaoRes", "GET", data);
}
function getNewsGgzykCanYueZiLiaoRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "zjjs_zheJiangShiPin";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("参阅资料");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a href="' + resultData[i].fileUrl + '" target="_blank"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, baseUrl + "/common/resource/searchCommonResource", size, nowPage, data, "getNewsGgzykCanYueZiLiaoRes");
}

// 最新
function getNewsZuiXin(tClassificationId) {
    var data = {
        thematicClassificationId: tClassificationId,
        commonNewsTypeId: 10,
        bookId: 5,
        page: 0,
        size: 5
    };

    commonAjax(baseUrl + "/common/resource/getNews", data, "getNewsZuiXinRes", "GET", data);
}
function getNewsZuiXinRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "ggzyk_zuiXin";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("最新");

    for (var i = 0; i < resultData.length; i++) {
        if (resultData[i].field3 == "1") {
            listHtml += '<a href="' + resultData[i].field2 + '" target="_blank">';
        } else {
            listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '">';
        }
        listHtml += '<li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, baseUrl + "/common/resource/getNews", size, nowPage, data, "getNewsZuiXinRes");
}

// 公共资源库标题搜索
function getGgzykTitleSouSuo(keyWord, tClassificationId) {
    var data = {
        thematicClassificationId: tClassificationId,
        title: keyWord,
        bookId: 5,
        page: 0,
        size: 5
    };

    commonAjax(baseUrl + "/common/resource/getNews", data, "getGgzykTitleSouSuoRes", "GET", data);
}
function getGgzykTitleSouSuoRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_liLunQianYan";

    var resultData = res.obj.content;

    var listHtml = "";

    $(".RightBoxBottom").find(".toptitle").html("标题搜索");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/resource/getNews", size, nowPage, data, "getGgzykTitleSouSuoRes");
}

// 公共资源库内容搜索
function getGgzykContentSouSuo(keyWord, tClassificationId) {
    var data = {
        thematicClassificationId: tClassificationId,
        text: keyWord,
        page: 0,
        size: 5
    };

    commonAjax(baseUrl + "/common/resource/getNews", data, "getGgzykContentSouSuoRes", "GET", data);
}
function getGgzykContentSouSuoRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "fourBook_liLunQianYan";

    var resultData = res.obj.content;

    var listHtml = "";

    $(".RightBoxBottom").find(".toptitle").html("正文搜索");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/resource/getNews", size, nowPage, data, "getGgzykContentSouSuoRes");
}

/******************************************** 浙江精神 ********************************************/

// 实践案例
function getNewsZjjsShiJianAnLi() {
    var data = {
        commonNewsTypeId: 3,
        bookId: 6,
        status: "UP",
        page: nowPage,
        size: size
    };

    commonAjax(baseUrl + "/common/resource/getNews", data, "getNewsZjjsShiJianAnLiRes", "GET", data);
}
function getNewsZjjsShiJianAnLiRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "zjjs_shiJianAnLi";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("实践案例");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, baseUrl + "/common/resource/getNews", size, nowPage, data, "getNewsZjjsShiJianAnLiRes");
}

// 红船精神
function getNewsZjjsHongChuanJingShen() {
    var data = {
        commonNewsTypeId: 4,
        bookId: 6,
        page: nowPage,
        size: size
    };

    commonAjax(baseUrl + "/common/resource/getNews", data, "getNewsZjjsHongChuanJingShenRes", "GET", data);
}
function getNewsZjjsHongChuanJingShenRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "zjjs_hongChuanJingShen";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("红船精神");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, baseUrl + "/common/resource/getNews", size, nowPage, data, "getNewsZjjsHongChuanJingShenRes");
}

// 浙江新闻
function getNewsZjjsZheJiangXinWen() {
    var data = {
        newsTypeId: 2,
        status: "UP",
        page: nowPage,
        size: size
    };

    commonAjax(baseUrl + "/common/firstPage/searchCommonNews", data, "getNewsZjjsZheJiangXinWenRes", "GET", data);
}
function getNewsZjjsZheJiangXinWenRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "zjjs_zheJiangXinWen";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("浙江新闻");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, basePath + "/common/firstPage/searchCommonNews", size, nowPage, data, "getNewsZjjsZheJiangXinWenRes");
}

// 理论研究
function getNewsZjjsLiLunYanJiu() {
    var data = {
        commonNewsTypeId: 2,
        bookId: 6,
        status: "UP",
        page: nowPage,
        size: size
    };

    commonAjax(baseUrl + "/common/resource/getNews", data, "getNewsZjjsLiLunYanJiuRes", "GET", data);
}
function getNewsZjjsLiLunYanJiuRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "zjjs_liLunYanJiu";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("理论研究");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookgongGaoDetail(this)" data-id="' + resultData[i].id + '" theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, baseUrl + "/common/resource/getNews", size, nowPage, data, "getNewsZjjsLiLunYanJiuRes");
}

// 浙江视频
function searchCommonResourceZjjsZheJiangShiPin() {
    var data = {
        type: "ZHE_JIANG_VIDEO",
        bookId: 6,
        status: "UP",
        page: nowPage,
        size: size
    };

    commonAjax(searchCommonResourceUrl, data, "searchCommonResourceZjjsZheJiangShiPinRes", "GET", data);
}
function searchCommonResourceZjjsZheJiangShiPinRes(res, data, pageNum) {
    nowPage = typeof(pageNum) == "undefined" ? 0 : pageNum;

    type = "zjjs_zheJiangShiPin";

    var listHtml = "";

    var resultData = res.obj.content;

    $(".RightBoxBottom").find(".toptitle").html("浙江视频");

    for (var i = 0; i < resultData.length; i++) {
        listHtml += '<a onclick="lookVideoDetail(this)" data-id="' + resultData[i].id + '"  theType="' + type + '"><li class="clearfix">';
        listHtml += '<div>' + resultData[i].title + '</div>';
        listHtml += '<div class="small-list">';
        listHtml += '<p>' + changeTime2(resultData[i].creatTime) + '</p>';
        listHtml += '</div>';
        listHtml += '</li></a>';
    }

    $(".RightBoxBottom").find(".list").html(listHtml);

    page(res.obj, searchCommonResourceUrl, size, nowPage, data, "searchCommonResourceZjjsZheJiangShiPinRes");
}

/******************************************** 查看详情 ********************************************/

// 查看非视频内容
function lookgongGaoDetail(btn) {
    var followId = $(btn).attr("data-id");
    var theType = $(btn).attr("theType");
    sessionStorage.setItem("followId", JSON.stringify(followId));
    sessionStorage.setItem("type", JSON.stringify(theType));
    self.location.href = "xq.html"
}

// 查看视频内容
function lookVideoDetail(btn) {
    var followId = $(btn).attr("data-id");
    var theType = $(btn).attr("theType");
    sessionStorage.setItem("followId", JSON.stringify(followId));
    sessionStorage.setItem("type", JSON.stringify(theType));
    window.open("video.html");
}